package fun.werfamily.wf.user.core.domain.constant;

import java.util.concurrent.ThreadLocalRandom;

/**
 * @Author: Mr.WenMing Zhang
 * @Date: 2021-12-17 10:15
 * @Description:
 **/
public interface RedisTimeoutConstants {

    /**
     * 缓存5-10秒
     */
    long CACHE_HOLD_TIME_5TO10S = ThreadLocalRandom.current().nextInt(5, 10);

    /**
     * 缓存10秒
     */
    long CACHE_HOLD_TIME_10S = 10L;

    /**
     * 缓存30秒
     */
    long CACHE_HOLD_TIME_30S = 30L;

    /**
     * 缓存1-2分钟
     */
    long CACHE_HOLD_TIME_1TO2M = ThreadLocalRandom.current().nextInt(1, 2) * 60L;

    /**
     * 缓存1-5分钟
     */
    long CACHE_HOLD_TIME_1TO5M = ThreadLocalRandom.current().nextInt(1, 5) * 60L;

    /**
     * 缓存3-5分钟
     */
    long CACHE_HOLD_TIME_3TO5M = ThreadLocalRandom.current().nextInt(3, 5) * 60L;

    long CACHE_HOLD_TIME_5M = 5 * 60L;

    /**
     * 缓存5-10分钟
     */
    long CACHE_HOLD_TIME_5TO10M = ThreadLocalRandom.current().nextInt(5, 10) * 60L;

    /**
     * 缓存30-60分钟
     */
    long CACHE_HOLD_TIME_30TO60M = ThreadLocalRandom.current().nextInt(30, 60) * 60L;

    /**
     * 缓存1-3小时
     */
    long CACHE_HOLD_TIME_1TO3H = ThreadLocalRandom.current().nextInt(1, 3) * 60 * 60L;

    /**
     * 缓存7天
     */
    long CACHE_HOLD_TIME_7DAY = 7 * 24 * 60 * 60L;

    /**
     * 缓存23-24小时左右
     */
    long CACHE_HOLD_TIME_1DAY = ThreadLocalRandom.current().nextInt(23, 24) * 60 * 60L;
}
